<?php
namespace Home\Controller;
use Common\Controller\CommonController;
class IndexController extends CommonController {
    public function index(){
		$where["status"]=array("EQ","1");
		$list=M('About')->where($where)->order('add_time desc')->getField('content');
		$pic1=M('Sales')->where($where)->getField('pic');
		$pic2=M('Sales')->where($where)->order('add_time desc')->getField('pic');
		$art=M('Article')->where($where)->order("add_time desc")->limit(6)->select();
		$banner['desc']=M('Banner')->where(array('position_id'=>5,$where))->select();
		$banner['first']=M('Banner')->where(array('position_id'=>1,$where))->select();
		$this->assign('art',$art);
		$this->assign('list',$list);
		$this->assign("banner",$banner);
		$this->assign('pic1',$pic1);
		$this->assign('pic2',$pic2);
		//热销产品
		unset($where);
		$where["status"]=1;
		$where["position_id"]=3;
		$product_list=M("Product")->where($where)->limit(4)->select();
		$this->assign("product_list",$product_list);
		//公司详情
		unset($where);
		$where["status"]=1;
		$where["position_id"]=5;
		$company=M("Banner")->where($where)->select();
		$this->assign("company",$company);
		
		$this->display();
    }
}